import './App.css';
import Login from './views/Login';
import Register from './views/Register';
import Index from './views/Index';
import Topic from './views/Topic';
import Artist from './views/Artist';
import ShowGroup from './views/ShowGroup';
import NotFound from './views/NotFound'

import MyFav from "./views/MyFav";
import MyRate from "./views/MyRate";
import Coupon from "./views/Coupon";
import Performer from "./views/Performer";
import Mygroup from "./views/Mygroup";
import Address from "./views/Address";
import Service from "./views/Service";
import Feedback from "./views/Feedback";
import Problem from "./views/Problem";

//rcc 生成类组件
//rsf 生成函数式组件

import React, { Component } from 'react';
import { Redirect, Route, Switch } from "react-router-dom";
class App extends Component {
  render() {
    return (
      <div className='app'>
        <Switch>
          <Route path="/index" component={Index}></Route>
          <Route path="/login" component={Login}></Route>
          <Route path="/topic" component={Topic}></Route>
          <Route path="/artist" component={Artist}></Route>
          <Route path="/showgroup" component={ShowGroup}></Route>
          <Route path="/register" component={Register}></Route>
          <Route exact path="/myfav" component={MyFav}></Route>
          <Route exact path="/myrate" component={MyRate}></Route>
          <Route exact path="/coupon" component={Coupon}></Route>
          <Route exact path="/performer" component={Performer}></Route>
          <Route exact path="/mygroup" component={Mygroup}></Route>
          <Route exact path="/address" component={Address}></Route>
          <Route exact path="/service" component={Service}></Route>
          <Route exact path="/feedback" component={Feedback}></Route>
          <Route exact path="/problem" component={Problem}></Route>
          <Redirect exact from='/' to="/index"></Redirect>
          <Route path="*" component={NotFound}></Route>
        </Switch>
      </div>
    );
  }
}

export default App;